nvim-surround 使用方法
* はカーソル位置を表す
ys
括弧を追加
yank surround
ds
括弧を削除
delete surround
cs
括弧を置換
change surround
エイリアスがある
a: >
b: )
B: }
r: ]
q:
s:
table:ノーマルモード
Old text Command New text
surr*ound_words ysiw) (surround_words)
require"nvim-surroun*d" ysa") require("nvim-surround")
char c = *x; ysl' char c = 'x';
int a[] = *32 yst;} int a[] = {32};
*make strings ys$" "make strings"
remove <b>HTML ta*gs</b> dst remove HTML tags
local x = ({ *32 }) ds) local x = { 32 }
See ':h h*elp' ds' See :h help
'change quot*es' cs'" "change quotes"
'*some string' cs'" "some string"
use<*"hello"> cs>) use("hello")
come text* cs`} {some text}
<b>or tag* types</b> csth1<CR> <h1>or tag types</h1>
delete(functi*on calls) dsf function calls
div cont*ents ysstdiv <div>div contents</div>
h1 *contents yssth1 id="x" <h1 id="x>h1 contents</h1>
<div>d*iv contents</div> dst div contents
<h1 id="head">t*ext</h1> cstdiv <div id="head">text</div>
<h1 id="head">text*</h1> csTdiv <div>text</div>
arg*s ysiwffunc func(args)
f*unc_name(a, b, x) dsf a, b, x
f*unc_name(a, b, x) csfnew_name new_name(a, b, x)
sample* text yssb (sample text)
table:インサートモード
Old text Command New text
local str = * <C-g>s" local str = "*"
local tab = * <C-g>s} local str = {*}
table:インサートモード
Old text Command New text
local str = |some text| S' local str 'some text'
|div id="test"|</div> S> <div id="test"></div>